#include<stdio.h>

int main()
{
	int sign,flag;
	int m,p,n,k,d,sum=0,sum1=0,sum2=0;
	scanf("%d %d %d",&m,&p,&n);
	sum1=m;
	for(sign=0;sign<n;sign++)
	{
		scanf("%d %d",&k,&d);
		sum1+=k;
		sum2+=(-k)*d;
	}
	sum+=sum1*d+sum2;
	printf("%d",sum);
	return 0;
}
